{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=509
  Verdict: Accepted
}
{$APPTYPE CONSOLE}
var i,count:integer; s:string;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
readln(s);
s:='!!'+s;
count:=0;
for i:=3 to length(s) do begin
  if (s[i] in ['a'..'z','A'..'Z']) and (not (s[i-1] in ['a'..'z','A'..'Z'])) then begin
    if s[i-1]='-' then begin
      if (not (s[i-2] in ['a'..'z','A'..'Z'])) then inc(count);
    end else inc(count);
  end;
end;
writeln(count);
end.